/**
 * MCSavePartOfFile.java
 */
package commands.model;
import dataTypes.File;

/**
 * Request to save a part of a download file.
 * @author Michal Kolodziejski
 */
public class MCSavePartOfFile extends ModelCommand {
	/** A file of which a part is requested to be saved. */
	private File file;
	/** Data of the file's part. */
	private byte[] data;
	/** A number of the file's part. */
	private int partNumber;
	
	
	/**
	 * Constructor
	 * @param file a file of which a part is requested to be saved
	 * @param data data of the file's part
	 * @param partNumber a number of the file's part
	 */
	public MCSavePartOfFile(File file, byte[] data, int partNumber){
		super(ModelCommandType.SAVE_PART_OF_FILE);
		this.file = file;
		this.data = data;
		this.partNumber = partNumber;
	}

	/**
	 * @return the data of the file's part
	 */
	public byte[] getData() {
		return data;
	}

	/**
	 * @return the file of which a part is requested to be saved
	 */
	public File getFile() {
		return file;
	}

	/**
	 * @return the number of the file's part
	 */
	public int getPartNumber() {
		return partNumber;
	}
}
